<template>
  <div>
    <div class="list">
      <div
        @click="$emit('click', item)"
        v-for="(item, index) in lists"
        :key="index"
        class="item"
      >
        <div class="cover">
          <img :src="item.coverImg" alt="" />
        </div>
        <div class="info">
          <p>{{ item.bookName }}</p>
          <p>作者 : {{ item.author }}</p>
          <p>
            简介 :
            {{ item.introduce }}
          </p>
        </div>
      </div>
      <div class="item item-placeholder"></div>
    </div>
  </div>
</template>

<script>
export default {
  name: "WorkspaceJsonBookItem",
  props: {
    lists: {
      default: "",
    },
  },
  data() {
    return {};
  },

  mounted() {},

  methods: {},
};
</script>

<style lang="scss" scoped>
.list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  flex-wrap: wrap;
  .item {
    flex: 1;
    min-width: 350px;
    height: 130px;
    background: #fff;
    border-radius: 10px;
    margin: 10px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.07);
    display: flex;
    margin-bottom: 80px;
    .cover {
      flex: none;
      width: 100px !important;
      height: 130px;
      padding: 20px 15px 10px;
      text-align: center;
      background: #fff;
      border-radius: 6px;
      box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.07);
      position: relative;
      top: -60px;
      margin-left: 20px;
      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }

    .info {
      padding: 15px 10px;
      margin-left: 5px;
      p {
        color: #999;
        font-size: 14px;
        &:nth-child(1) {
          color: #333;
          font-weight: 600;
          font-size: 16px;
        }

        &:nth-child(2) {
          margin-top: 2px;
        }
        &:nth-child(3) {
          @include main-text-hidden(2);
        }
      }
    }
  }

  .item-placeholder {
    opacity: 0;
    height: 0;
  }
}
</style>
